package ronglei.day01.demo07String;
/*
* 分割字符串的方法
* public String[] splic(String regex) 将字符串分割 返回一个字符串数组
*注意 英文必须"\\."
* */
public class String06 {
    public static void main(String[] args) {
        String str1 = "aaa,bbb,ccc";
        String[] split = str1.split(",");
        System.out.println(split[1]);
        for (int i = 0; i < split.length; i++) {
            System.out.println(split[i]);
        }


        String  str3 = "aaa.bbb.ccc";
        String[] split2 = str3.split("\\.");//英文必须"\\."
        for (int i = 0; i < split2.length; i++) {
            System.out.println(split2[i]);
        }
    }
}
